<?php
require_once (dirname(__FILE__) .'/PtObjectAbstract.php');
class PtConfigItem extends PtObjectAbstract 
{
    public $id;
    public $id_tab;
    public $id_parent;
    public $name;
    public $position;
    public $active;
    
    public $label;
    public $description;
    public $lang_iso;
    
	public $date_add;
    public $date_upd;
    
    public static $definition = array(
        'table' => 'pt_config_item',
        'primary' => 'id_item',
        'multilang' => true,
        'fields' => array(
            'id_tab' => array(
                'type' => self::TYPE_INT,
                'required' => true, 
                'validate' => 'isUnsignedId'
            ),
            'id_parent' => array(
                'type' => self::TYPE_INT,
                'required' => true, 
                'validate' => 'isUnsignedId'
            ),
            'name' => array(
                'type' => self::TYPE_STRING,
                'required' => true,
                'validate' => 'isGenericName', 
                'size' => 64
            ),
            'position' => array(
                'type' => self::TYPE_INT
            ),
            
            'label' => array(
                'type' => self::TYPE_STRING,
                'required' => true,
                'lang' => true, 
                'validate' => 'isGenericName', 
                'size' => 128
            ),
            'description' => array(
                'type' => self::TYPE_STRING,
                'lang' => true,
                'validate' => 'isGenericName',
            ),
            'lang_iso' => array(
                'type' => self::TYPE_STRING,
                'required' => true,
                'lang' => true, 
                'size' => 2,
                'validate' => 'isGenericName',
            ),
            
            'active' => array(
                'type' => self::TYPE_BOOL,
                'required' => true
            ),
            'date_add' =>  array(
                'type' => self::TYPE_DATE, 
                'validate' => 'isDateFormat'
            ),
			'date_upd' => array(
                'type' => self::TYPE_DATE,
                'validate' => 'isDateFormat'
            )
        )
    );
}